package com.nthink.indicators.service.hospitalindicators.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nthink.indicators.mapper.hospitalindicators.PatientTreatmentFeeMapper;
import com.nthink.indicators.pojo.condition.TimeCondition;
import com.nthink.indicators.pojo.hospitalindicators.PatientTreatmentFee;
import com.nthink.indicators.service.hospitalindicators.PatientTreatmentFeeService;
import org.springframework.stereotype.Service;


@Service
public class PatientTreatmentFeeServiceImpl extends ServiceImpl<PatientTreatmentFeeMapper, PatientTreatmentFee> implements PatientTreatmentFeeService {

    public PatientTreatmentFee getData(TimeCondition timeCondition) {
        PatientTreatmentFee patientTreatmentFee = new PatientTreatmentFee();
        patientTreatmentFee.setCostPerOutpatient(baseMapper.getCostPerOutpatient(timeCondition.getStartTime(),timeCondition.getEndTime()));
        patientTreatmentFee.setOutMedicineCost(baseMapper.getOutMedicineCost(timeCondition.getStartTime(),timeCondition.getEndTime()));
        patientTreatmentFee.setCostPerInpatient(baseMapper.getCostPerInpatient(timeCondition.getStartTime(),timeCondition.getEndTime()));
        patientTreatmentFee.setInMedicineCost(baseMapper.getInMedicineCost(timeCondition.getStartTime(),timeCondition.getEndTime()));
        return patientTreatmentFee;
    }
}
